import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'
import {createStackNavigator} from '@react-navigation/stack';
import HomeScreen from './scene/Home/HomeScreen';
import Web from "./scene/Web/Web";
import ProductList from "./scene/Shop/ProductList";
import ProductInfo from "./scene/Shop/ProductInfo";
import Cart from "./scene/Shop/Cart";
import OrderList from "./scene/Shop/OrderList";
import Profile from "./scene/User/Profile";
import Register from "./scene/User/Register";
import Inventory from "./scene/Admin/Inventory";
import Sales from "./scene/Admin/Sales";
import AccountReceivable from "./scene/Admin/AccountReceivable";
createBottomTabNavigator();
const Stack = createStackNavigator();
require('./img/home.png');
require('./img/mine.png');
const screenList = [
    {
        name: "Nexus Technologies",
        component: HomeScreen,
        isMain: true
    },
    {
        name: "shop",
        component: ProductList,
        title: "Product List"
    },
    {
        name: "web",
        component: Web,
        title: "Upload payment proof"
    },
    {
        name: "viewProduct",
        component: ProductInfo,
        title: "Product info"
    },
    {
        name: "cart",
        component: Cart,
        title: "Cart"
    },
    {
        name: "orderList",
        component: OrderList,
        title: "Order list"
    },
    {
        name: "profile",
        component: Profile,
        title: "Edit profile"
    },
    {
        name: "register",
        component: Register,
        title: "Register user"
    },
    {
        name: "inventory",
        component: Inventory,
        title: "Inventory analysis"
    },
    {
        name: "sales",
        component: Sales,
        title: "Sales & Gross Profit report"
    },
    {
        name: "accountReceivable",
        component: AccountReceivable,
        title: "Accounts receivable analysis"
    }
]

export default function Routing() {
    return (
        <NavigationContainer>
            <Stack.Navigator>
                {
                    screenList.map((item, index) => {
                        return (
                            <Stack.Screen
                                key={index}
                                name={item.name}
                                component={item.component}
                                options={
                                    {title: item.title, headerShown: !item.isMain}
                                }
                            />
                        )
                    })
                }
            </Stack.Navigator>
        </NavigationContainer>
    );
}
